//
//  DHTabBarViewController.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/4/12.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHTabBarViewController.h"
#import "DHS2_HomeViewController.h"
#import "DHSubscriptionController.h"
#import "DHSaleViewController.h"
#import "DHShoppingCartViewController.h"
#import "DHNewsViewController.h"

@interface DHTabBarViewController ()

@end

@implementation DHTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupViewControllers];
}

- (void)setupViewControllers{
    
    DHS2_HomeViewController *homeController = [DHS2_HomeViewController new];
    UINavigationController *nav_home = [[UINavigationController alloc] initWithRootViewController:homeController];
    nav_home.navigationBarHidden = YES;
    nav_home.tabBarItem.image = [UIImage imageNamed:@"tab_home"];
    nav_home.title = @"首页";
    
    DHSubscriptionController *subscriptionController = [DHSubscriptionController new];
    UINavigationController *nav_subscription = [[UINavigationController alloc] initWithRootViewController:subscriptionController];
    nav_subscription.navigationBarHidden = YES;
    nav_subscription.tabBarItem.image = [UIImage imageNamed:@"tab_subscription"];
    nav_subscription.title = @"订阅";
    
    DHSaleViewController *saleController = [DHSaleViewController new];
    UINavigationController *nav_sale = [[UINavigationController alloc] initWithRootViewController:saleController];
    nav_sale.navigationBarHidden = YES;
    nav_sale.tabBarItem.image = [UIImage imageNamed:@"tab_sale"];
    nav_sale.title = @"特卖";
    
    DHShoppingCartViewController *shoppingCartController = [DHShoppingCartViewController new];
    UINavigationController *nav_shoppingCart = [[UINavigationController alloc] initWithRootViewController:shoppingCartController];
    nav_shoppingCart.navigationBarHidden = YES;
    nav_shoppingCart.tabBarItem.image = [UIImage imageNamed:@"tab_shoppingcar"];
    nav_shoppingCart.title = @"购物车";
    
    DHNewsViewController *newsController = [DHNewsViewController new];
    UINavigationController *nav_news = [[UINavigationController alloc] initWithRootViewController:newsController];
    nav_news.navigationBarHidden = YES;
    nav_news.tabBarItem.image = [UIImage imageNamed:@"tab_news"];
    nav_news.title = @"资讯";
    
    [self setViewControllers:@[nav_home, nav_subscription, nav_sale, nav_shoppingCart, nav_news] animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
